<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [
            {name:"肯德基",price:100,distance:100},
            {name:"必胜客",price:200,distance:500},
            {name:"华莱士",price:50,distance:1000}
        ]
        arr.sort(function(a,b){
            return a.price-b.price;
        })
        console.log(arr)
        arr.sort(function(a,b){
            return b.distance-a.distance;
        })
        console.log(arr)
    </script>
</body>
</html>